<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="${ctx}/static/lib/layui/css/layui.css">
<style type="text/css">
	.main_div{
		margin : 15px;
	}
</style>
</head>
<body>
  	<div class="main_div">
		<form id="from_update" class="layui-form layui-form-pane" action="">
		<input type="hidden" id="id" name="id"/>
		  <div class="layui-form-item">
		    <label class="layui-form-label">销售机会</label>
		    <div class="layui-input-block">
		      <input type="text" name="saleChanceId" id="saleChanceId" autocomplete="off" value="${param.saleChanceId}"  class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">计划项</label>
		    <div class="layui-input-block">
		      <input type="text" name="planItem" id="planItem" lay-verify="required"  autocomplete="off" class="layui-input">
		    </div>
		  </div>
		  
		 <div class="layui-form-item">
		      <label class="layui-form-label">验证日期</label>
		      <div class="layui-input-inline">
		        <input type="text" name="planDate" id="planDate" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
		      </div>
		    </div>
		    
		  <div class="layui-form-item">
		    <label class="layui-form-label">执行效果</label>
		    <div class="layui-input-inline">
		      <input type="text" name="exeAffect" id="exeAffect" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		    <div class="layui-form-item">
			    <label class="layui-form-label">选择开发状态</label>
			    <div class="layui-input-block">
			      <select name="devResult" value="1" lay-verify="required">
			        <option value="">未开发</option>
			        <option value="0">未开发</option>
			        <option value="1">开发中</option>
			        <option value="2">开发成功</option>
			        <option value="3">开发失败</option>
			      </select>
			    </div>
			  </div>
		</form>
		<input type="button" class="layui-btn" onclick="submitForm()" value="修改">
	</div>


	<script src="${ctx}/static/back/js/jquery.js"></script>
	<script src="${ctx}/static/commom/mylayer.js"></script>
	<script src="${ctx}/static/commom/util.js"></script>
	<script src="${ctx}/static/lib/layui/layui.js"></script>
	<script>
 	layui.config({
	    base : '${ctx}/static/lib/'
	  }).extend({
	    selectM: './layui_extends/selectM'
	  }).use(['form','upload','selectM','laydate'],function(){
	  	var form = layui.form;
	  	var upload = layui.upload;
	  	var selectM = layui.selectM;
	  	var laydate = layui.laydate;
	  	laydate.render({
			   elem: '#planDate' //指定元素
			});
		  //监听select选择
		  //下拉选择框被选中时触发，回调函x数返回一个object参数，携带两个成员：
	
	  });
		
		//ajax方式提交form表单
		function submitForm(){
			$.ajax({
				url : '${ctx}/kaifa/insert.action',
				data : $('#from_update').serialize(),
				type : 'POST',
				dataType : 'json',
				success : function(resp) {
					if(resp.code == util.SUCCESS) {
						location.href = "${ctx}/salechance/tosalechancepage.action"
					} else {
						mylayer.errorMsg(resp.msg);
					}
				}
			});
		}
		/* $.ajax({
			url : "${ctx}/salechance/selectBychanceId",
			type : "post",
			data : {"saleChanceId" : "${param.saleChanceId}"},
			dataType : "json",
			success : function(resp){
				if(resp.code == util.SUCCESS){
					mylayer.success(resp.msg);
					
				}
			}
		}) */
		
	  
	</script>
</body>
</html>
